// Kony

#pragma once

#include "CoreMinimal.h"
#include "BehaviorTree/Tasks/BTTask_MoveTo.h"
#include "BTTask_MoveTo8Directions.generated.h"

/**
 * 自定义AI任务：8方向移动
 * 继承自官方的BTTask_MoveTo，只重写移动方向计算
 */
UCLASS()
class GASC_HUANLING_API UBTTask_MoveTo8Directions : public UBTTask_MoveTo
{
	GENERATED_BODY()
	
public:
	UBTTask_MoveTo8Directions();
	
protected:
	// 重写TickTask来应用8方向移动
	virtual void TickTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;
	
	// 重写移动逻辑，应用8方向标准化
	virtual void OnTaskFinished(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTNodeResult::Type TaskResult) override;
	
private:
	// 8方向标准化函数
	FVector NormalizeTo8Directions(const FVector& Direction);
}; 